package com.siemens.exercise;

import java.util.ArrayList;

@SuppressWarnings("serial")
public class NegtiveNumException extends Exception {
	public NegtiveNumException() {}
	
	//list of negative numbers
	ArrayList<Integer> negativeNumArray;
	public NegtiveNumException (ArrayList<Integer> list) {
		this.negativeNumArray = list;
	}
	
	@Override
	public String toString() {
		StringBuffer errorMsg = new StringBuffer();
		errorMsg.append("Negatives not allowed.");
		
		for(Integer i : negativeNumArray) {
			errorMsg.append(i + " ");
		}
		
		return errorMsg.toString();
	}
}
